home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vcls / wfc007.000 / include / lsockets.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-08  |  1.3 KB  |  48 lines

  1. #ifndef LISTENING_SOCKET_CLASS_HEADER
  2.  
  3. /*
  4. ** Author: Samuel R. Blackburn
  5. ** CI$: 76300,326
  6. ** Internet: sammy@sed.csc.com
  7. **
  8. ** You can use it any way you like.
  9. */
  10.  
  11. #define LISTENING_SOCKET_CLASS_HEADER
  12.  
  13. class CListeningSocket : public CSimpleSocket
  14. {
  15.    private:
  16.  
  17.       SOCKET m_ServerSocketID; // Used in listen()
  18.  
  19.       int m_NumberOfSimultaneousSocketsToAllow;
  20.  
  21.       void m_Initialize( void );
  22.  
  23.    public:
  24.  
  25.       CListeningSocket();
  26.       CListeningSocket( SOCKET client_id );
  27.  
  28.       /*
  29.       ** Destructor should be virtual according to MSJ article in Sept 1992
  30.       ** "Do More with Less Code:..."
  31.       */
  32.  
  33.       virtual ~CListeningSocket();
  34.  
  35.       virtual void OnNewConnection( SOCKET socket_id, const char *host_name, const char *dotted_ip_address_string ) = 0; // Called by WaitForConnection
  36.       virtual BOOL Open( void );
  37.       virtual BOOL Open( const char *channel_name, UINT port_number = 23, CFileException * perror = NULL );
  38.       virtual BOOL WaitForConnection( const char *p_name );
  39.       virtual BOOL WaitForConnection( const int p_number );
  40.       virtual BOOL WaitForConnection( void );
  41.  
  42.       // Overriding CObject Functions
  43.  
  44.       void Dump( CDumpContext& dc ) const;
  45. };
  46.  
  47. #endif // LISTENING_SOCKET_CLASS_HEADER
  48.